<template>
  <div id="order-details">
    <!-- nav导航栏 -->
    <van-nav-bar fixed>
      <template #left>
        <van-icon name="arrow-left" />
      </template>
      <template #title>
        <span>订单状态{{}}</span>
      </template>
      <template #right>
        <van-icon name="weapp-nav" />
      </template>
    </van-nav-bar>

    <!-- 订单卡片头部标题 -->
    <van-nav-bar class="orderCard-title">
      <template #left class="title-shop">
        <router-link to="/">
          <img src="../assets/logo.png" alt="" class="shop-logo" />
          <p>店铺名称{{}}</p>
          <van-icon name="arrow" class="shop-in" />
        </router-link>
      </template>
    </van-nav-bar>

    <!-- 订单卡片主体 -->
    <van-card class="diy-card" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
      <template #title>
        <router-link to="/">
          <div>
            <span
              >商品标题商品标题商品标题商品标题商品标题商品标题商品标题{{}}</span
            >
            <span>商品单价{{}}</span>
          </div>
        </router-link>
      </template>
      <template #desc>
        <router-link to="/">
          <div>
            <span>描述信息{{}}</span>
            <span>购买数量{{}}</span>
          </div>
        </router-link>
      </template>
      <template #tags>
        <van-tag plain type="danger">优惠政策{{}}</van-tag>
      </template>
      <template #footer>
        <router-link to="/">
          <van-button size="mini">加入购物车</van-button>
        </router-link>
        <router-link to="/">
          <van-button size="mini">申请售后</van-button>
        </router-link>
      </template>
    </van-card>

    <!-- 订单信息 -->
    <div class="order-inform">
      <div>
        <img src="../assets/logo.png" alt="" />
        <span>探索全球美好生活</span>
      </div>
      <div>
        <van-collapse v-model="activeNames">
          <van-collapse-item name="1">
            <template #title>
              <span>实付款</span>
              <span>￥24.72{{}}</span>
            </template>
            <van-cell-group>
              <van-cell>
                <template #title>商品总价{{}}</template>
                <template #default>￥25.80</template>
              </van-cell>
              <van-cell>
                <template #title>运费{{}}</template>s
                <template #default>￥0.00</template>
              </van-cell>
              <van-cell class="discount-text">
                <template #title>红包抵扣{{}}</template>
                <template #default>-￥1.08</template>
              </van-cell>
            </van-cell-group>
          </van-collapse-item>
        </van-collapse>
      </div>

      <div>
        <van-collapse v-model="activeNames">
          <van-collapse-item title="标题1" name="2">
            <template #title>
              <div>
                <span>订单信息</span>
                <span>查看更多</span>
              </div>
            </template>
            <!-- <div class="diy-inform-cell">绝对是个家品牌官方</div> -->

            <!--
              自定义插槽组件 
              <Mycell>
              <template v-slot:cellTitle>title</template>
              <template v-slot:cellValue>value</template>
            </Mycell> -->

            <van-cell>
              <template #title>收货信息</template>
              <template #default
                >宋美龄和工会哦哦结果平时的坚实的破解建瓯盘</template
              >
            </van-cell>
            <van-cell>
              <template #title>订单编号</template>
              <template #default>1342255543612523</template>
            </van-cell>
            <van-cell>
              <template #title>创建时间</template>
              <template #default>2021-11-11 00:00:00</template>
            </van-cell>
            <van-cell>
              <template #title>付款时间</template>
              <template #default>2021-11-11 01:01:01</template>
            </van-cell>
            <van-cell>
              <template #title>发货时间</template>
              <template #default>2021-11-11 00:00:00</template>
            </van-cell>
            <van-cell>
              <template #title>成交时间</template>
              <template #default>2021-11-11 01:01:01</template>
            </van-cell>
          </van-collapse-item>
        </van-collapse>
      </div>

      <van-grid direction="horizontal" :column-num="2">
        <van-grid-item icon="photo-o" text="联系卖家" />
        <van-grid-item icon="photo-o" text="拨打电话" />
      </van-grid>
    </div>

    <div class="may-like">
      ——<van-icon name="like" /> <span>你可能还喜欢</span>——
    </div>

    <div style="display: flex; justify-content: space-around">
      <div class="diy-grid-left">
        <van-grid :column-num="1">
          <van-grid-item v-for="value in 6" :key="value" text="文字">
            <template #icon>
              <van-image src="https://img01.yzcdn.cn/vant/apple-1.jpg" />
            </template>
            <template #text>
              <div style="width: 100%; height: 100px">
                <p>这里是推荐商品的标题{{}}</p>
                <div>
                  <span>￥33.3{{}}</span>
                  <span>2200人购买{{}}</span>
                </div>
              </div>
            </template>
          </van-grid-item>
        </van-grid>
      </div>
      <div class="diy-grid-right">
        <van-grid :column-num="1">
          <van-grid-item v-for="value in 6" :key="value" text="文字">
            <template #icon>
              <van-image src="https://img01.yzcdn.cn/vant/apple-1.jpg" />
            </template>
            <template #text>
              <div style="width: 100%; height: 100px">
                <p>这里是推荐商品的标题{{}}</p>
                <div>
                  <span>￥33.3{{}}</span>
                  <span>2200人购买{{}}</span>
                </div>
              </div>
            </template>
          </van-grid-item>
        </van-grid>
      </div>
    </div>
  </div>
</template>

<script>
// import Mycell from "../components/Mycell.vue"
export default {
  // components: { Mycell },
  data() {
    return {
      activeNames: ["0"],
    }
  },
}
</script>

<style lang="scss" scoped>
#order-details {
  background-color: rgb(240, 240, 240);
}
.van-nav-bar:first-child {
  z-index: 2;
  background-image: linear-gradient(to right, #f38a27, #fa5700);
  .van-nav-bar__left {
    > i {
      color: white;
    }
  }
  .van-nav-bar__title {
    > span {
      color: white;
    }
  }
  .van-nav-bar__right {
    > i {
      color: white;
    }
  }
}

// 订单标题
.orderCard-title {
  //   border: 1px solid black;
  border-bottom: 0;
  margin-top: 2.875rem;
  padding: 0 0.625rem 0 0.625rem;
  .shop-logo {
    width: 0.9rem;
    height: 0.9rem;
    margin-left: 0.6rem;
    float: left;
    margin-top: 1rem;
  }
  .shop-in {
    color: #aaaaaa;
    float: left;
    line-height: 2.875rem;
  }
  p {
    margin: 0;
    float: left;
    line-height: 2.875rem;
  }
  & > div {
    & > div:first-child {
      p {
        margin-left: 0.3rem;
        font-weight: 600;
        color: #111111;
      }
    }
    & > div:last-child {
      p {
        color: orangered;
      }
    }
  }
}

// 订单卡片
.diy-card {
  // border: 1px solid black;
  border-top: 0;
  margin: 0 0 0.625rem 0;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
  // box-shadow: 0 2px 0 0 gray;
  .van-card__content {
    > div:first-child {
      padding-top: 0.333rem;
      text-align: left;
      > div,
      > span {
        margin-top: 0.444rem;
      }

      // 商品标题+商品单价行
      > a:nth-child(1) > div {
        font-weight: 600;
        color: #111111;
        display: flex;
        justify-content: space-between;
        > span:first-child {
          display: block;
          width: 9.666rem;
          // 设置单行溢出,用省略号代替
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }
      // 描述信息+购买数量行
      > a:nth-child(2) > div {
        color: #888888;
        display: flex;
        justify-content: space-between;
        margin-top: 0.333rem;
      }
      > span {
        line-height: 1rem;
        transform: scale(0.8);
        margin-left: -0.4rem;
        color: orangered;
      }
    }
  }
  .van-card__footer {
    > a > button:nth-child(1) {
      border: 1px solid #cccccc;
      border-radius: 1rem;
      width: 5rem;
      height: 2rem;
      font-weight: 600;
    }
    > a > button:nth-child(2) {
      border: 1px solid #cccccc;
      border-radius: 1rem;
      width: 5rem;
      height: 2rem;
      font-weight: 600;
    }
    > a > button:nth-child(3) {
      border: 1px solid rgba(255, 68, 0, 0.5);
      border-radius: 1rem;
      width: 5rem;
      height: 2rem;
      font-weight: 600;
      color: orangered;
    }
  }
}

.order-inform {
  // height: 10rem;
  // background-color: white;
  > div:nth-child(1) {
    height: 1.5rem;
    text-align: left;
    padding: 0.625rem;
    img {
      width: 1.5rem;
      height: 1.5rem;
      vertical-align: middle;
    }
    span {
      display: inline-block;
      font-size: 0.75rem;
      color: #888888;
    }
  }

  // 下拉菜单1
  > div:nth-child(2) {
    text-align: right;
    > div > div > div > .van-cell__title {
      span:first-child {
        color: #111111;
      }
      span:last-child {
        color: orangered;
      }
    }
    .van-cell-group {
      > .van-cell {
        font-size: 0.75rem;
        padding: 0;
        .van-cell__title {
          text-align: left;
          line-height: 1.25rem;
        }
        .van-cell__value {
          line-height: 1.25rem;
        }
      }

      // 红包折扣
      > .discount-text {
        .van-cell__value {
          color: orangered;
        }
      }
    }
  }

  // 下拉菜单2
  > div:nth-child(3) {
    .van-cell__title {
      > div {
        display: flex;
        justify-content: space-between;
        span:nth-child(2) {
          font-size: 0.75rem;
          color: #888888;
        }
      }
    }

    .diy-inform-cell {
      width: 100%;
      border: 1px solid red;
      margin: 0;
    }

    .van-cell:first-child + div {
      .van-cell__title {
        // border: 1px solid blue;
        text-align: left;
        width: 100px;
      }
      .van-cell__value {
        width: 300px !important;
        // border: 1px solid red;
        width: 300px;
        text-align: left;
        margin-left: -100px;
      }
    }
  }
}

.may-like {
  height: 2.5rem;
  color: orangered;
  span {
    line-height: 2.5rem;
  }
}

.diy-grid-left {
  width: 47%;
  height: 500px;
}
.diy-grid-right {
  width: 47%;
  height: 500px;
}
</style>
